package com.itheima.duotai;
/*
披着羊皮的狼
 */
public class Test {
    public static void main(String[] args) {
       /* Sheep sheep = new Sheep();
        System.out.println(sheep.mao);
        sheep.eat();
        Wolf wolf = new Wolf();
        System.out.println(wolf.mao);
        wolf.eat();*/
       //披着羊皮的狼
        Sheep sheep=new Wolf();
        System.out.println(sheep.mao);
        sheep.eat();

    }

}

class Sheep{

    String mao="羊毛";

    public void eat(){
        System.out.println("羊吃草");
    }

}
class Wolf extends Sheep{
    String mao="狼毫";
    @Override
    public void eat(){
        System.out.println("狼吃羊");
    }


}